/**
 * 渲染类 构造函数
 */
var LBRender    = function (options) {

    this._options       = {};
    this._layerQueue	= [];
	this._x				= 0;
	this._y				= 0;

    for (var name in options) {

        this.setOption(name, options[name]);
    }
}

/**
 * 设置配置项
 */
LBRender.prototype.setOption    = function (name, value) {

    this._options[name] = value;
}

/**
 * 设置上下文对象
 */
LBRender.prototype.setContext	= function (context) {

    this._context = context;
}

/**
 * 获取配置项
 */
LBRender.prototype.getOption    = function (name) {

    return  this._options[name];
}

LBRender.prototype.appendLayer	= function (layer) {

	this._layerQueue.push(layer);	
}

LBRender.prototype.getLayerQueue	= function () {
	
	return	this._layerQueue;
}

LBRender.prototype.setPosition	= function (x, y) {

	this._x	= x;
	this._y	= y;	
}

LBRender.prototype.draw			= function () {
	
	for (var offsetQueue = 0;offsetQueue < this._layerQueue.length;offsetQueue ++) {

		this._layerQueue[offsetQueue].setPosition(this._x, this._y);
		this._layerQueue[offsetQueue].setContext(this._context);
		this._layerQueue[offsetQueue].draw();
	}
}